/*
 * @Description: super 类
 * @notes: super指父类
 * @Author: 台火山
 * @Date: 2024-03-22 19:01:54
 * @LastEditors: 台火山
 * @LastEditTime: 2024-03-22 19:07:21
 */
// (function(){})();
(function () {
    class Animal {
        name: string;
        constructor(name: string) {
            this.name = name;
        }
        sayHello() {
            console.log('动物在叫~~~');
        }
    }
    class Dog extends Animal {
        age: number;
        constructor(name: string, age: number) {
            // 如果在子类中写了构造函数，在子类构造中必须对父类的构造函数进行调用
            super(name);
            this.age = age;
        }
        sayHello() {
            // 在类的方法中 super 就表示当前类的父类
            super.sayHello();
        }
    }
    const dog = new Dog('旺财', 3);
    dog.sayHello();
})();